home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 June / PersonalComputerWorld-June2009-CoverdiscCD.iso / Software / Freeware / Firebug 1.3.3 / firebug-1.3.3-fx.xpi / build.xml next >
Encoding:
Extensible Markup Language  |  2008-07-03  |  12.2 KB  |  282 lines

  1. <?xml version="1.0" ?>
  2.  
  3. <!-- This Ant build file was contributed by Paul McLanahan.  pmclanahan@gmail.com.
  4.     Added template and version numbers johnjbarton@johnjbarton.com
  5.     Added unexplore targets to strip trace for distribution version.
  6. -->
  7.  
  8. <project name="firebug" default="createBranchXPI">
  9.  
  10.  
  11.     <!-- Setting properties -->
  12.     <target name="local-check">
  13.         <available file="${basedir}/local.properties"
  14.            property="local.properties.available"/>
  15.     </target>
  16.  
  17.     <target name="properties-local"
  18.           if="local.properties.available"
  19.           depends="local-check">
  20.       <echo message="Loading local properties file"/>
  21.       <property file="local.properties"/>
  22.     </target>
  23.  
  24.     <target name="no-properties-local"
  25.             unless="local.properties.available"
  26.             depends="local-check">
  27.           <echo message="No local properties file, setting defaults"/>
  28.         <property name="install.dir" value="OperatingSystemPathTo:Profiles/fireclipse/"/>
  29.         <property name="update.path" value="http://getfirebug.com/releases"/>
  30.     </target>
  31.  
  32.     <target name="version" depends="properties-local, no-properties-local" description="Compute version number">
  33.         <tstamp/>
  34.         <property name="build_dir" location="./build" />
  35.         <property name="FULLVERSION"  value="${VERSION}${RELEASE}${TRUNK}"/>
  36.         <mkdir dir="${build_dir}/dist" />
  37.         <property name="dist_dir" location="${build_dir}/dist" />
  38.         <property name="FIREBUG-XPI" value="firebug-${VERSION}J${RELEASE}.xpi"/>
  39.     </target>
  40.  
  41.     <!-- eg
  42.         RELEASE=.88
  43.         VERSION=eval
  44.         TRUNK=.1.05
  45.         -->
  46.     <property file="content/firebug/branch.properties" />
  47.  
  48.     <!-- Project directories -->
  49.     <property name="src_dir" location="." />
  50.     <property name="build_dir" location="./build" />
  51.     <property name="dist_dir" location="./dist" />
  52.     <property name="unexplore.dir" location="../eval" />
  53.     <!-- relative to branches/firebug1.1 should be branches/eval -->
  54.  
  55.     <property name="excludes" value="**/.*, **/*.jar, **/*.db" />
  56.     <property name="components_dir" location="${src_dir}/components" />
  57.     <available file="${src_dir}/aptanadebugger" property="aptanadebugger"/>
  58.  
  59.     <!-- Targets -->
  60.     <target name="clean" depends="clean-reg">
  61.         <delete dir="${build_dir}" />
  62.         <delete dir="${dist_dir}" />
  63.     </target>
  64.  
  65.     <!-- Expand templates -->
  66.     <target name="install-dependency" description="test tpl files">
  67.         <uptodate property="install.expansion.notRequired" targetfile="${src_dir}/install.rdf">
  68.             <srcfiles dir="${src_dir}" includes="install.rdf.tpl.xml, content/firebug/branch.properties"/>
  69.         </uptodate>
  70.     </target>
  71.  
  72.     <target name="update-dependency" description="test update files">
  73.         <condition property="update.expansion.notRequired">
  74.             <or>
  75.                 <not>
  76.                     <available file="update.rdf.tpl.xml"/>
  77.                 </not>
  78.                 <uptodate targetfile="update.rdf">
  79.                     <srcfiles dir="${src_dir}" includes="update.rdf.tpl.xml, branch.properties"/>
  80.                 </uptodate>
  81.             </or>
  82.         </condition>
  83.     </target>
  84.  
  85.     <target name="expand-templates" depends="expand-install-template, expand-update-template, verify-update-template-expansion" description="Fill in version info">
  86.     </target>
  87.     <target name="expand-install-template" depends="install-dependency, version" unless="install.expansion.notRequired" >
  88.         <copy file="${src_dir}/install.rdf.tpl.xml"
  89.                tofile="${src_dir}/install.rdf"
  90.                overwrite="true">
  91.                <filterchain>
  92.                        <replacetokens>
  93.                             <token key="FULLVERSION" value="${FULLVERSION}"/>
  94.                             <token key="VERSION" value="${VERSION}J"/>
  95.                             <token key="RELEASE" value="${RELEASE}"/>
  96.                             <token key="UPDATEPATH" value="${update.path}/firebug/${VERSION}"/>
  97.                        </replacetokens>
  98.                </filterchain>
  99.         </copy>
  100.     </target>
  101.  
  102.     <target name="expand-update-template" depends="update-dependency, version" unless="update.expansion.notRequired" >
  103.         <copy file="${src_dir}/update.rdf.tpl.xml"
  104.                tofile="${build_dir}/update.rdf"
  105.                overwrite="true">
  106.                <filterchain>
  107.                        <replacetokens>
  108.                             <token key="FULLVERSION" value="${FULLVERSION}"/>
  109.                             <token key="VERSION" value="${VERSION}J"/>
  110.                             <token key="RELEASE" value="${RELEASE}"/>
  111.                             <token key="LEAF" value="firebug-${VERSION}${RELEASE}.xpi"/>
  112.                             <token key="UPDATEPATH" value="${update.path}/firebug/${VERSION}"/>
  113.                               <token key="EXPERIMENTORURL" value="http://www.almaden.ibm.com/u/bartonjj"/>
  114.                        </replacetokens>
  115.                </filterchain>
  116.         </copy>
  117.         <echo message="expanded ${src_dir}/update.rdf.tpl.xml"/>
  118.     </target>
  119.     <target name="verify-update-template-expansion" depends="update-dependency" if="update.expansion.notRequired">
  120.         <echo message="update.expansion.notRequired true"/>
  121.     </target>
  122.  
  123.     <target name="release-documentation" depends="clean, version, expand-templates">
  124.         <copy file="${src_dir}/docs/index.tpl.html"
  125.                tofile="${src_dir}/docs/index.html"
  126.                overwrite="true">
  127.                <filterchain>
  128.                        <replacetokens>
  129.                             <token key="FIREBUG-VERSION" value="${RELEASE}"/>
  130.                             <token key="CHROMEBUG-VERSION" value="${CHROMEBUG.FULLVERSION}"/>
  131.                             <token key="UPDATEPATH" value="${update.path}"/>
  132.                        </replacetokens>
  133.                </filterchain>
  134.         </copy>
  135.     </target>
  136.  
  137.     <!-- Incremental Build Targets -->
  138.     <target name="dev-setup" depends="create-extension-links, expand-templates">
  139.  
  140.     </target>
  141.  
  142.     <target name="create-extension-links" depends="version">
  143.         <!-- These links are one line files with paths pointing into our source -->
  144.         <echo message="Writing links from ${install.dir}/extensions to ${basedir}"/>
  145.  
  146.         <mkdir dir="${install.dir}/extensions" />
  147.  
  148.         <path id="firebug-dev">
  149.             <pathelement location="${basedir}"/>
  150.         </path>
  151.         <pathconvert refid="firebug-dev" property="firebug-dev"/>
  152.  
  153.         <echo message="${firebug-dev}" file="${install.dir}/extensions/firebug@software.joehewitt.com" />
  154.  
  155.     </target>
  156.  
  157.     <target name="firebug-service" depends="version" description="Check compreg.dat when service changes">
  158.         <uptodate property="deleteCompreg.notRequired" srcfile="./components/firebug-service.js" targetfile="${install.dir}/compreg.dat" />
  159.     </target>
  160.  
  161.     <target name="clean-reg" depends="firebug-service" unless="deleteCompreg.notRequired"
  162.         description="Delete compreg.dat to reload service" >
  163.         <delete file="${install.dir}/compreg.dat"/>
  164.     </target>
  165.  
  166.     <!-- Distribution XPI Targets -->
  167.     <target name="createChromeJAR">
  168.         <mkdir dir="${build_dir}" />
  169.         <zip destfile="${build_dir}/${ant.project.name}.jar" update="true" basedir="${src_dir}"
  170.             includes="content/**, locale/**, skin/**" excludes="${excludes}"/>
  171.     </target>
  172.  
  173.     <target name="createPlatformJARs">
  174.         <mkdir dir="${build_dir}/Darwin" />
  175.         <mkdir dir="${build_dir}/Linux" />
  176.         <mkdir dir="${build_dir}/linux-gnu" />
  177.         <mkdir dir="${build_dir}/WINNT" />
  178.         <zip destfile="${build_dir}/Darwin/${ant.project.name}.jar" update="true"
  179.             basedir="${src_dir}/platform/Darwin" includes="skin/**" excludes="${excludes}" />
  180.         <zip destfile="${build_dir}/Linux/${ant.project.name}.jar" update="true"
  181.             basedir="${src_dir}/platform/Linux"
  182.             includes="skin/**"
  183.             excludes="${excludes}"
  184.         />
  185.         <zip destfile="${build_dir}/linux-gnu/${ant.project.name}.jar" update="true"
  186.             basedir="${src_dir}/platform/linux-gnu"
  187.             includes="skin/**"
  188.             excludes="${excludes}"
  189.         />
  190.         <zip destfile="${build_dir}/WINNT/${ant.project.name}.jar" update="true"
  191.             basedir="${src_dir}/platform/WINNT"
  192.             includes="skin/**"
  193.             excludes="${excludes}"
  194.         />
  195.     </target>
  196.  
  197.     <target name="zipIntoXPI" depends="clean, createChromeJAR, createAptanaJAR">
  198.         <mkdir dir="${dist_dir}" />
  199.         <antcall target="integrateAptana"/>
  200.         <zip destfile="${dist_dir}/${ant.project.name}.xpi" update="true">
  201.             <zipfileset dir="${build_dir}" includes="*.jar" prefix="chrome" />
  202.             <zipfileset dir="${src_dir}" includes="icons/**" prefix="chrome" excludes="${excludes}" />
  203.             <zipfileset dir="${src_dir}/platform" includes="**" prefix="platform" excludes="${excludes}, **/skin/**" />
  204.             <zipfileset dir="${src_dir}/components" includes="*.js" prefix="components" />
  205.             <zipfileset dir="${src_dir}/defaults" includes="**" prefix="defaults" excludes="${excludes}" />
  206.             <zipfileset dir="${src_dir}" includes="install.rdf" />
  207.             <zipfileset dir="${src_dir}" includes="jarred.manifest" fullpath="chrome.manifest"/>
  208.         </zip>
  209.     </target>
  210.  
  211.     <target name="createDistributionXPI" depends="zipIntoXPI" >
  212.         <copy file="${dist_dir}/${ant.project.name}.xpi" tofile="${dist_dir}/${ant.project.name}.xpi.zip" />
  213.     </target>
  214.  
  215.     <target name="createBranchXPI" depends="clean, version, expand-templates, zipIntoXPI, release-documentation" >
  216.         <move file="${dist_dir}/firebug.xpi" tofile="${dist_dir}/${FIREBUG-XPI}"/>
  217.         <copy file="${build_dir}/update.rdf" tofile="${dist_dir}/update.rdf" />
  218.     </target>
  219.  
  220.  
  221.     <!-- Trace Removal Targets: copy this dir to ../eval, strip lines with /*@explore*/ -->
  222.     <target name="clean-unexplore"
  223.         description="Delete contents of unexplore directory" >
  224.         <fail>
  225.             <condition>
  226.                    <not>
  227.                     <isset property="unexplore.dir"/>
  228.                </not>
  229.              </condition>
  230.         </fail>
  231.         <delete includeEmptyDirs="true">
  232.             <fileset dir="${unexplore.dir}" includes="**/*" excludes="**/.svn"/>
  233.         </delete>
  234.     </target>
  235.  
  236.     <target name="copy-to-unexplore"
  237.         description="copy to clean out tracing code before xpi">
  238.         <copy todir="${unexplore.dir}" >
  239.             <fileset dir=".">
  240.                 <exclude name="build/**"/>
  241.                 <exclude name="dist/**"/>
  242.                 <exclude name="lite/**"/>
  243.                 <exclude name="aptanadebugger/**"/>
  244.                 <exclude name="**/.svn"/>
  245.                 <exclude name="update.rdf"/>
  246.                 <exclude name="install.rdf"/>
  247.             </fileset>
  248.         </copy>
  249.     </target>
  250.  
  251.  
  252.     <target name="unexplore" depends="version, expand-templates, clean-unexplore, copy-to-unexplore">
  253.         <replaceregexp match=".*/\*@explore\*/.*\n" replace="" flags="g">
  254.             <fileset dir="${unexplore.dir}" includes="**/*.js"/>
  255.             <fileset dir="${unexplore.dir}" includes="**/*.xul"/>
  256.         </replaceregexp>
  257.         <echo message="Removing X for explore from RELEASE in ${unexplore.dir}/branch.properties"/>
  258.         <replaceregexp match="(RELEASE=[^X]*)X" replace="\1" file="${unexplore.dir}/branch.properties"/>
  259.         <echo message="Build Distribution XPI in ${unexplore.dir}"/>
  260.         <ant target="createBranchXPI" dir="${unexplore.dir}" inheritAll="false"/>
  261.         <delete file="${unexplore.dir}/update.rdf.tpl.xml"/> <!-- Freeze update.rdf in future builds -->
  262.         <echo message="** Now use McCoy to sign update.rdf **"/>
  263.     </target>
  264.  
  265.     <target name="createAptanaJAR" if="aptanadebugger">
  266.         <echo message="Create aptanadebugger.jar"/>
  267.         <mkdir dir="${build_dir}" />
  268.         <zip destfile="${build_dir}/aptanadebugger.jar" update="true" basedir="${src_dir}/aptanadebugger/"
  269.             includes="content/**, locale/**, skin/**" excludes="${excludes}"/>
  270.     </target>
  271.  
  272.     <target name="integrateAptana" if="aptanadebugger">
  273.         <echo message="Integrate AptanaDebugger"/>
  274.         <concat destfile="${build_dir}/chrome.manifest" force="yes">
  275.             <fileset file="${src_dir}/chrome.manifest"/>
  276.             <fileset file="${src_dir}/aptanadebugger/chrome.manifest"/>
  277.         </concat>
  278.     </target>
  279.  
  280.  
  281. </project>
  282.